Skip to main content

load extension

Type

command

Summary

Load a LiveCode Builder extension.

Syntax

load extension {from file <filePath> | from data <moduleData>} [ with resource path <resourcePath> ]

Description

Use the load extension command to load a LiveCode Builder extension. If the extension is a library, its public handlers will be added to the bottom of the message path. If it is a widget, it will be available as a control in the tools palette to drag out, or to create with the create widget command.

If the moduleData or the data loaded from filePath contains more than one LiveCode Builder module, then the first module is treated as the extension's main module and the remaining modules are treated as support modules. Support modules are only kept loaded if they are used by the main module. Support modules' names must begin with the name of the main module.

Parameters

NameTypeDescription

filePath

The path to a compiled LiveCode Builder extension file.

moduleData

Binary data that constitutes a valid compiled LiveCode Builder extension.

resourcePath

The path to use for any operations in the extensions that use resource files (eg 'image from resource file').

Examples

load extension from file "packaged_extensions/com.livecode.widget.navbar/module.lcm"
if the result is empty then
create widget "My Navbar" as "com.livecode.widget.navbar"
end if
local tExtensionData
put url ("binfile:" \
& tMyExtensionFolder & slash & "module.lcm" ) into tExtensionData
load extension from data tExtensionData with resource path (tMyExtensionFolder \
& slash & "resources" )

glossary: LiveCode Builder extension, command

command: unload extension, create widget

function: loadedExtensions, result

Compatibility and Support

Introduced

LiveCode 8.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?